<!-- 表格 -->
<template>
  <div class="box">
    <div class="box-header">
      <div @click="fanhui">《返回</div>
      <div>填表</div>
      <div></div>
    </div>
    <div class="box-bbody">
      <div class="box-box1">房源管理</div>
      <div class="da-bbody">
        <!-- 搜索房子 -->
        <div class="fangzi">
          <p>小区名</p>
          <div class="inpp">
            <input type="text" placeholder="请输入如需要的房子" />
          </div>
          <p><span>></span></p>
        </div>
        <!-- 租金 -->
        <div class="fangzi">
          <p>租金</p>
          <div class="inpp"><input type="text" placeholder="请输入金额" /></div>
          <p><span>半月/月￥</span></p>
        </div>
        <!-- 建筑面积 -->
        <div class="fangzi">
          <p>建筑面积</p>
          <div class="inpp">
            <input type="text" placeholder="输入房子面积" />
          </div>
          <p><span>rm</span></p>
        </div>
        <!-- //选择城市 -->
        <div class="box-box2">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="户型"
            placeholder="点击选择户型"
            @click="showPicker = true"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
        </div>
        <div class="box-box2">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="楼层"
            placeholder="点击选择楼层"
            @click="showPicker = true"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
        </div>
        <div class="box-box2">
          <van-field
            readonly
            clickable
            name="picker"
            :value="value"
            label="朝向"
            placeholder="点击选择朝向"
            @click="showPicker = true"
          />
          <van-popup v-model="showPicker" position="bottom">
            <van-picker
              show-toolbar
              :columns="columns"
              @confirm="onConfirm"
              @cancel="showPicker = false"
            />
          </van-popup>
        </div>
        <div class="box-box3">房屋标识</div>
        <div class="box-box4">
          <input
            type="text"
            placeholder="请输入详细地址（列如：整租 2室：500元）"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      //选着器
      value: "",
      columns: ["大房子", "小房子", "豪宅别墅", "主席房", "游艇别墅"],
      showPicker: false,
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    fanhui() {
      this.$router.push("/Home");
    },
    //选着器
    onConfirm(value) {
      this.value = value;
      this.showPicker = false;
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
};
</script>
<style lang='scss' scoped>
.box {
  width: 100%;
  height: auto;
  // height: 100%;
  display: flex;
  flex-direction: column;
  background: paleturquoise;
  font-size: 14px;
}
.box-header {
  width: 100%;
  height: 1rem;
  background: #fff;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 20px;
}
.box-bbody {
  width: 100%;
  flex: 1;
  overflow-x: hidden;
  background: rgb(255, 255, 255);
}
.da-bbody {
  margin: 0 auto;
  width: 90%;
  height: auto;
  background: rgb(255, 255, 255);
  display: flex;
  flex-direction: column;
  font-size: 10px;
}
.box-box1 {
  width: 100%;
  height: 1rem;
  border-bottom: 1px solid #000;
  line-height: 1rem;
  padding: 0px 15px;
  font-weight: bolder;
  font-size: 14px;
}
.fangzi {
  width: 100%;
  height: 1rem;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fangzi p {
  width: 20%;
  // height: 100%;
  text-align: center;
}
.inpp {
  width: 60%;
  height: 100%;
  background: orange;
}
.inpp input {
  width: 100%;
  height: 100%;
  outline: none;
  border: none;
  background: rgb(240, 238, 238);
}
.box-box2 {
  width: 100%;
  height: 1rem;
  border-bottom: 1px solid #000;
  overflow-x: hidden;
}
.box-box2 .van-cell van-cell--clickable van-field {
  width: 100%;
  height: 1rem;
  background: orange;
}
.box-box3 {
  width: 100%;
  height: 0.7rem;
  // background: red;
  border-bottom: 1px solid #000;
  line-height: 0.7rem;
  padding: 0px 10px;
}
.box-box4 {
  width: 100%;
  height: 0.7rem;
  background: red;
  // border-bottom: 1px solid #000;
  line-height: 0.7rem;
  padding: 0px 10px;
}
.box-box4 input {
  width: 100%;
  height: 100%;
  background: #fff;
  outline: none;
  border: none;
}
</style>